@extends('admin')

@section('content')
    <div class="nav">
        <ul class="cc">
            <li class="current">
                <a href="{{url('admin/content/'.$mark)}}">{{ $model->title }}</a>
            </li>
        </ul>
    </div>

    <form action="{{url('admin/content/update/'.$mark)}}" method="POST" class="J_ajaxForm">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">

        <div class="h_a">编辑内容</div>

        <div class="table_full">

            <table width="100%">
                <colgroup>
                    <col class="th">
                    <col>
                </colgroup>
                <tbody>

                <tr>
                    <th><label for="title">标题 <span class="red">*</span></label></th>
                    <td>
                        <input type="text" name="title" id="title" class="input length_6" value="{{$model->title}}"/>
                    </td>
                </tr>

                <tr>
                    <th><label for="description">摘要 </label></th>
                    <td>
                        <textarea name="description" id="description" style="width:350px; height: 50px;">{{ $model->description }}</textarea>
                    </td>
                </tr>

                <tr>
                    <th><label for="content">内容 <span class="red">*</span></label></th>
                    <td>
                        <script id="container" name="content" type="text/plain">
                            {!! $model->content !!}
                        </script>
                    </td>
                </tr>

                </tbody>
            </table>
        </div>

        <div class="btn_wrap">
            <div class="btn_wrap_pd">
                <button type="submit" class="btn btn_submit mr10 J_ajax_submit_btn">提交</button>
            </div>
        </div>

    </form>
@stop

@section('js')
    @parent
    @include('UEditor::head')
    <script>
        var ue = UE.getEditor('container', {initialFrameWidth: 600, initialFrameHeight:800, autoHeightEnabled: true, toolbars: [
            ['source', 'undo', 'redo', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc'],
            ['link', 'simpleupload', 'insertimage']
        ]});
        ue.ready(function() {
            ue.execCommand('serverparam', '_token', GV.TOKEN);//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.
        });
    </script>
@stop
